package 牛客.树;



public class test {

    public static void main(String[] args){
        BTree<Integer> tree = new BTree<Integer>();
        for (int i = 0; i < 10; i++) {
            tree.RandomCreatTree(tree.root, i);
        }
        System.out.println("---------递归前序遍历-----------");
        tree.preOrder(tree.root);

        System.out.println();
        System.out.println("---------非递归前序遍历----------");
        tree.NPreOrder(tree.root);

        System.out.println();
        System.out.println("---------递归中序遍历-----------");
        tree.inOrder(tree.root);

        System.out.println();
        System.out.println("---------非递归中序遍历----------");
        tree.NinOrder(tree.root);

        System.out.println();
        System.out.println("---------递归后序遍历------------");
        tree.postOrder(tree.root);

        System.out.println();
        System.out.println("---------非递归后序遍历------------");
        tree.NPostOrder(tree.root);



    }
}
